home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ehllsp16.zip / SP016.CMD < prev    next >
OS/2 REXX Batch file  |  1993-01-14  |  10KB  |  245 lines

  1. /* SP016.CMD */
  2. "echo off"
  3. parse upper arg Base_Drive CMLIB_Drive Verified Samples .
  4. if Base_Drive = "?" then signal syntax
  5.  
  6. start:
  7. "cls"
  8. say "                                                                   "
  9. say "         ╔═════════════════════════════════════════════╗           "
  10. say "         ║   IBM OS/2 EHLLAPI Virtual Device Driver    ║           "
  11. say "         ║                SelectPak 016                ║           "
  12. say "         ║             (prereq = ACS 6000)             ║           "
  13. say "         ╚═════════════════════════════════════════════╝           "
  14. say "                                                                   "
  15. say "                                                                   "
  16. say "                                                                   "
  17.  
  18. /* get the Base Drive letter */
  19. get_Base_Drive:
  20. call charout ,"  Which drive is your base operating system on? (ie: C)  "
  21. if Base_Drive \= "" then signal got_Base_Drive
  22. parse upper linein Base_Drive
  23. got_Base_Drive:
  24. if Base_Drive = "" then
  25.   do
  26.   say "  You must enter a drive letter."
  27.   signal get_Base_Drive
  28.   end
  29. "dir "Base_Drive":\OS2                                           > NUL 2>>&1"
  30. if RC \= 0 then
  31.   do
  32.   say
  33.   say "  "Base_Drive": does not have the \OS2 directory.             "
  34.   say "  You must enter the drive letter which has the \OS2 directory."
  35.   say "  Press enter to continue.                                     "
  36.   parse upper linein ignore
  37.   Base_Drive = ""
  38.   signal get_Base_Drive
  39.   end
  40. LOG = ""Base_Drive":\OS2\INSTALL\SP016.LOG"
  41. say
  42. say "  The SelectPak log will be written to "LOG"."
  43. say "  Your CONFIG.SYS will be backed up to CONFIG.OLD."
  44. say "  PCSHELL.DLL will be copied to "Base_Drive":\OS2\DLL\."
  45. say
  46. say
  47.  
  48. /* get the CMLIB Drive letter */
  49. get_CMLIB_Drive:
  50. call charout ,"  Which drive is your communications manager on? (ie: C)  "
  51. if CMLIB_Drive \= "" then signal got_CMLIB_Drive
  52. parse upper linein CMLIB_Drive
  53. got_CMLIB_Drive:
  54. if CMLIB_Drive = "" then
  55.   do
  56.   say "  You must enter a drive letter."
  57.   signal get_CMLIB_Drive
  58.   end
  59. "dir "CMLIB_Drive":\CMLIB                                       > NUL 2>>&1"
  60. if RC \= 0 then
  61.   do
  62.   say
  63.   say "  "CMLIB_Drive": Does not have the \CMLIB directory.                 "
  64.   say "  You must enter the drive letter which contains the \CMLIB directory."
  65.   say "  Press enter to continue.                                            "
  66.   parse upper linein ignore
  67.   CMLIB_Drive = ""
  68.   signal get_CMLIB_Drive
  69.   end
  70. say
  71. say "  Your VHAPI.OS2 will be renamed to VHAPI.OLD".
  72. say "  The new VHAPI.OS2 will be copied to "CMLIB_Drive":\CMLIB\VHAPI.OS2".
  73. say
  74.  
  75. Samples:
  76. say
  77. say "  You will require 230k on "Base_Drive" to install the sample programs."
  78. call charout , "  Do you want to install the sample programs? (Y/N)   "
  79. if Samples \= "" then signal got_Samples
  80. parse upper linein Samples
  81. got_Samples:
  82. if Samples  = "N" then signal no_Samples
  83. if Samples \= "Y" then
  84.   do
  85.   say
  86.   say "  Valid responses are Y and N"
  87.   Samples = ""
  88.   signal Samples
  89.   end
  90. say
  91. say "  The DOS sample program will be copied to "Base_Drive":\DOSSAMPL\."
  92. say "  The Windows sample program will be copied to "Base_Drive":\WINSAMPL\."
  93. say
  94. signal verify
  95. no_Samples:
  96. say
  97. say "  The sample programs will not be installed."
  98. say
  99.  
  100. verify:
  101. say
  102. call charout ,"  Are these parameters correct? (Y\N)  "
  103. if Verified \= "" then signal got_verify
  104. parse upper linein Verified
  105. got_verify:
  106. if Verified = "N" then
  107.   do
  108.   Base_Drive = ""
  109.   CMLIB_Drive = ""
  110.   Samples = ""
  111.   Verified = ""
  112.   signal start
  113.   end
  114. if Verified \= "Y" then
  115.   do
  116.   say
  117.   say "  Valid responses are Y and N"
  118.   Verified = ""
  119.   signal verify
  120.   end
  121. say
  122.  
  123. /* Check to see that the customer has WR06000 or WR06010 installed */
  124.  
  125. SYSLEVEL = ""CMLIB_Drive":\CMLIB\SYSLEVEL.ACS"
  126. firstline = linein(SYSLEVEL)
  127.  
  128. RC = stream(SYSLEVEL,'c','close')
  129.  
  130. level = substr(firstline,45,7)
  131.  
  132. if level \= 'WR06010' & level \= 'WR06000' then
  133. do
  134.         say
  135.         say "  This SelectPak prereqs ACS 6000"
  136.         say "  which is not installed ... Quitting"
  137.         say
  138.         signal End
  139. end
  140.  
  141. "echo.                                                           >> "LOG
  142. "echo         ╔═════════════════════════════════════════════╗    >> "LOG
  143. "echo         ║   IBM OS/2 EHLLAPI Virtual Device Driver    ║    >> "LOG
  144. "echo         ║                SelectPak 016                ║    >> "LOG
  145. "echo         ╚═════════════════════════════════════════════╝    >> "LOG
  146. "echo.                                                           >> "LOG
  147. "echo.                                                           >> "LOG
  148. "echo.                                                           >> "LOG
  149. say
  150. PATH = ""CMLIB_Drive":\CMLIB"
  151. "echo backing up "PATH"\SYSLEVEL.ACS                             >>"LOG" 2>>&1"
  152. "copy "PATH"\SYSLEVEL.ACS SYSLVOLD.ACS                           >>"LOG" 2>>&1"
  153. "echo backing up "PATH"\VHAPI.OS2 as "PATH"\VHAPI.OLD            >>"LOG" 2>>&1"
  154. "copy "PATH"\VHAPI.OS2 "PATH"\VHAPI.OLD                          >>"LOG" 2>>&1"
  155.  
  156. /* Unzip the files! */
  157. "PKUNZIP2 -n SP016.ZIP PCSHLL.DLL "Base_Drive":\OS2\DLL\         >>"LOG" 2>>&1"
  158. if RC = 0 then signal Zip_Done1
  159. if RC = 11 then
  160.   do
  161.   say "                                                               "
  162.   say "  "Base_Drive":\OS2\DLL\PCSHLL.DLL does not require an update. "
  163.   signal Zip_Done1
  164.   end
  165. say "  Errors occurred during the unpacking. When installation completes "
  166. say "  browse "LOG" to view the errors.    "
  167. say "                                      "
  168. say "  Press enter to continue.            "
  169. parse upper linein ignore
  170.  
  171. Zip_Done1:
  172. "PKUNZIP2 -n SP016.ZIP VHAPI.OS2 "CMLIB_Drive":\CMLIB            >>"LOG" 2>>&1"
  173. if RC = 0 then signal Zip_Done2
  174. if RC = 11 then
  175.   do
  176.   say "                                               "
  177.   say "  "PATH"\VHAPI.DLL does not require an update. "
  178.   signal Zip_Done2
  179.   end
  180. say "  Errors occurred during the unpacking. When installation completes   "
  181. say "  browse "LOG" to view the errors.                                    "
  182. say "                                                                      "
  183. say "  Press enter to continue.                                            "
  184. parse upper linein ignore
  185.  
  186. Zip_Done2:
  187. "PKUNZIP2 -n SP016.ZIP SYSLEVEL.ACS "CMLIB_Drive":\CMLIB         >>"LOG" 2>>&1"
  188. if RC = 0 then signal Zip_Done3
  189. if RC = 11 then
  190.   do
  191.   say "                                               "
  192.   say "  "PATH"\SYSLEVEL.ACS does not require an update. "
  193.   signal Zip_Done3
  194.   end
  195. say "  Errors occurred during the unpacking. When installation completes   "
  196. say "  browse "LOG" to view the errors.                                    "
  197. say "                                                                      "
  198. say "  Press enter to continue.                                            "
  199. parse upper linein ignore
  200. Zip_Done3:
  201.  
  202. if Samples = "N" then signal skip_Samples
  203. "PKUNZIP2 -n -d SP016.ZIP SAMPLES\*.* "Base_Drive":\             >>"LOG" 2>>&1"
  204. if RC = 0 then signal Zip_Done4
  205. if RC = 11 then
  206.   do
  207.   say "                                             "
  208.   say "  No Samples found in "Base_Drive":\ requiring updates "
  209.   signal Zip_Done4
  210.   end
  211. say "  Errors occurred during the unpacking. When installation completes   "
  212. say "  browse "LOG" to view the errors.                                    "
  213. say "                                                                      "
  214. say "  Press enter to continue.                                            "
  215. parse upper linein ignore
  216. Zip_Done4:
  217. say "                                                                      "
  218. say "         ╔═════════════════════════════════════════════╗              "
  219. say "         ║     SP016 SelectPak Installation Complete.  ║              "
  220. say "         ╚═════════════════════════════════════════════╝              "
  221. say "                                                                      "
  222. signal End
  223.  
  224. /* Help panel */
  225. syntax:
  226. say "                                                                      "
  227. say "  You need only enter: SP016                                          "
  228. say "                                                                      "
  229. say "  You will then be prompted for:                                      "
  230. say "      1) The Drive with your Base Operation System.                   "
  231. say "         Enter the Drive letter which contains \OS2.                  "
  232. say "      2) The Drive with your Communications Manager.                  "
  233. say "         Enter the Drive letter which contains \CMLIB.                "
  234. say "      3) Do you wish to install the Sample Programs?                  "
  235. say "         Enter Y or N. (230k required)                                "
  236. say "      4) Are the above parameters correct?                            "
  237. say "         Enter Y or N.                                                "
  238. say "                                                                      "
  239. say "                                                                      "
  240. say "  You may stack the responses with the call to SP016 if you wish.     "
  241. say "      ie: SP016 C C Y Y                                               "
  242. say "                                                                      "
  243. say "                                                                      "
  244. End:
  245.